<template>
  <div>
    <h2>子组件isShow:{{ sonShow }}</h2>
    <el-button @click="changeSonShow">子组件按钮</el-button>
  </div>
</template>
<script lang="ts" setup>
const props = defineProps<{ isShow: boolean }>()
const emit = defineEmits<{
  (e: 'changeIshow', val: boolean): void
}>()

const sonShow = computed({
  get() {
    // console.log(props.isShow,'get')
    return props.isShow
  },
  set(val) {
    // console.log(val,'set')
    emit('changeIshow', val)
  },
})

const changeSonShow = () => {
  sonShow.value = !sonShow.value
  console.log(sonShow.value, '>>>>>>>')
}
</script>
<style lang="scss" scoped></style>
